﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        任务执行详情
    </title>
    <meta name="description" content="">
    <meta name="author" content="">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <!-- #CSS Links -->
    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/font-awesome.css">

    <!-- SmartAdmin Styles : Caution! DO NOT change the order -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production-plugins.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-skins.css">

    <!-- SmartAdmin RTL Support -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-rtl.css">

    <!-- Demo purpose only: goes with demo.js, you can delete this css when designing your own WebApp -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/demo.css">

    <!-- #FAVICONS -->
    <link rel="shortcut icon" href="img/favicon/favicon.ico" type="image/x-icon">
    <link rel="icon" href="img/favicon/favicon.ico" type="image/x-icon">

    <!-- #GOOGLE FONT -->
    <link rel="stylesheet" href="css/open-sans.css" type="text/css">

    <!-- #APP SCREEN / ICONS -->
    <link rel="apple-touch-icon" href="img/splash/sptouch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/splash/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/splash/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/splash/touch-icon-ipad-retina.png">

    <!-- iOS web-app metas : hides Safari UI Components and Changes Status Bar Appearance -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Startup image for web apps -->
    <link rel="apple-touch-startup-image" href="img/splash/ipad-landscape.png"
          media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)">
    <link rel="apple-touch-startup-image" href="img/splash/ipad-portrait.png"
          media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)">
    <link rel="apple-touch-startup-image" href="img/splash/iphone.png" media="screen and (max-device-width: 320px)">

    <link href="appcss/Common.css" rel="stylesheet" />

</head>
<body class="desktop-detected minified">

    <!-- #MAIN PANEL -->
    <div id="main" role="main">

        <!-- RIBBON -->
        <div id="ribbon">


            <span class="ribbon-button-alignment">
                <span class="btn btn-ribbon"><i class="fa fa-home"></i></span>
            </span>

            <!-- breadcrumb -->
            <ol class="breadcrumb">
                <li><a href="SchedulingTaskManagement.html">调度任务管理</a></li>
                <li>任务执行详情</li>
            </ol>
            <!-- end breadcrumb -->

        </div>
        <!-- END RIBBON -->
        <!-- MAIN CONTENT -->
        <div id="content">
            <div class="row hidden">
                <div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
                    <h1 class="page-title txt-color-blueDark">
                        <i class="fa fa-edit fa-fw "></i>
                        主页
                        <span>
                            >
                            任务执行详情
                        </span>
                    </h1>
                </div>

            </div>

            <!-- widget grid -->
            <section id="widget-grid" class="">

                <!-- row -->
                <div class="row">

                    <!-- NEW WIDGET START -->
                    <!-- NEW WIDGET START -->
                    <article class="col-sm-12 col-md-12 ">

                        <!-- Widget ID (each widget will need unique ID)-->
                        <div class="jarviswidget" id="wid-id-2" data-widget-colorbutton="false"
                             data-widget-editbutton="false">
                            <header>
                                <h2>任务执行详情</h2>

                            </header>

                            <!-- widget div-->
                            <div>

                                <!-- widget edit box -->
                                <div class="jarviswidget-editbox">
                                    <!-- This area used as dropdown edit box -->

                                </div>
                                <!-- end widget edit box -->
                                <!-- widget content -->
                                <div class="widget-body no-padding">

                                    <!-- Success states for elements -->

                                    <form action="#" class="smart-form">
                                        <fieldset>
                                            <div class="row">
                                                <section class="col col-1">
                                                    <label class="label" style="line-height: 32px;"> 任务 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="input"> <input type="text" id="TaskName" disabled="disabled" /> </label>
                                                </section>
                                                <section class="col col-1" >
                                                    <label class="label" style="line-height: 32px;"> 数据源 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="input"> <input type="text" id="SourceName" disabled="disabled" /></label>
                                                </section>
                                            </div>
                                            <div class="row">
                                                <section class="col col-1">
                                                    <label class="label" style="line-height: 32px;"> 数据表 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="input"> <input type="text" id="TableName" disabled="disabled" /> </label>
                                                </section>
                                                <section class="col col-1">
                                                    <label class="label" style="line-height: 32px;"> 批次 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="input"> <input type="text" id="BatchId" disabled="disabled" /></label>
                                                </section>
                                            </div>
                                            <div class="row">
                                                <section class="col col-1">
                                                    <label class="label" style="line-height: 32px;"> 执行时间 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="input"> <input type="text" id="CreatedTime" disabled="disabled" /> </label>
                                                </section>
                                                <section class="col col-1">
                                                    <label class="label" style="line-height: 32px;"> 状态 </label>
                                                </section>
                                                <section class="col col-5">
                                                    <label class="select">
                                                        <select id="Status" onchange="SearchData()">
                                                            <option value="1">数据类型不匹配</option>
                                                            <option value="2">数据审核失败</option>
                                                            <option value="3">编码转换失败</option>
                                                            <option value="4">等待数据审核</option>
                                                            <option value="5">插入数据失败</option>
                                                            <option selected="selected" value="6">插入数据成功</option>
                                                        </select>
                                                    </label>
                                                </section>
                                            </div>
                                           
                                        </fieldset>

                                        <fieldset>
                                            <section>
                                                <table class="table table-bordered table-hover" id="datalist-table">
                                                    <thead>
                                                        <tr id="table-header"></tr>
                                                    </thead>
                                                    <tbody></tbody>
                                                </table>
                                            </section>
                                        </fieldset>
                                        <footer id="hidden_input">
                                            <button type="button" class="btn btn-default" onclick="window.history.back();">
                                                返回
                                            </button>
                                        </footer>
                                    </form>
                                    <!--/ Success states for elements -->
                                </div>
                                <!-- end widget content -->
                            </div>
                            <!-- end widget div -->
                        </div>
                        <!-- end widget -->
                    </article>
                </div>

                <!-- end row -->

            </section>
        </div>
        <!-- END MAIN CONTENT -->
    </div>


    <!--================================================== -->
    <!-- PACE LOADER - turn this on if you want ajax loading to show (caution: uses lots of memory on iDevices)
    <script data-pace-options='{ "restartOnRequestAfter": true }' src="js/plugin/pace/pace.min.js"></script>-->
    <!-- #PLUGINS -->
    <!-- Link to Google CDN's jQuery + jQueryUI; fall back to local -->


    <script src="js/libs/jquery-2.1.1.min.js"></script>
    <script src="js/libs/jquery-ui-1.10.3.min.js"></script>
    <!-- BOOTSTRAP JS -->
    <script src="js/bootstrap/bootstrap.min.js"></script>

    <!-- IMPORTANT: APP CONFIG -->
    <script src="js/app.config.js"></script>


    <!-- CUSTOM NOTIFICATION -->
    <script src="js/notification/SmartNotification.min.js"></script>

    <!-- JARVIS WIDGETS -->
    <script src="js/smartwidgets/jarvis.widget.min.js"></script>


    <!-- SPARKLINES -->
    <script src="js/plugin/sparkline/jquery.sparkline.min.js"></script>

    <!-- JQUERY MASKED INPUT -->
    <script src="js/plugin/masked-input/jquery.maskedinput.min.js"></script>


    <!-- JQUERY UI + Bootstrap Slider -->
    <script src="js/plugin/bootstrap-slider/bootstrap-slider.min.js"></script>


    <script src="js/app.min.js"></script>
    <script src="appjs/Helper.js"></script>
    <script src="appjs/Common.js"></script>

    <script src="js/plugin/datatables/jquery.dataTables.min.js"></script>
    <script src="js/plugin/datatables/dataTables.colVis.min.js"></script>
    <script src="js/plugin/datatables/dataTables.tableTools.min.js"></script>
    <script src="js/plugin/datatables/dataTables.bootstrap.min.js"></script>
    <script src="js/plugin/datatable-responsive/datatables.responsive.min.js"></script>
    <script>
        var draw = 0;
        var batchId = GetQueryString("batchId");
        var taskId = GetQueryString("taskId");
        var cols = new Array();
        var table;
        var page = 1;
        var noAjaxForOneData;
        var SearchData = function () {
            if (draw != 0) {
                table.fnDraw();
            }
        }
        $(function () {
            $.ajax({
                url: apiUrl,
                dataType: "json",
                data: { "sys:sno": "BATCH", "sys:act": "GetDataList", "BatchId": batchId, "Status": $("#Status").val(), "Page": 0 },
                success: function (data) {
                    noAjaxForOneData = data;
                    if (data.IsSccuess) {
                        var newjson = new Array();
                        var theader = "";
                        for (var j = 0; j < data.Data.Columns.length; j++) {
                            if (data.Data.Columns[j].indexOf("_") == 0) {
                                // alert(data.Data.Columns[j].indexOf("_"));
                                continue;
                            }
                            cols.push({ data: data.Data.Columns[j] });
                            theader += ("<td>" + data.Data.Columns[j] + "</td>");
                        }
                        $("#table-header").html(theader);
                        initializationDataTable();
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert("失败（" + "错误代码：" + data.ErrorCode + "，错误信息：" + data.Message + ")");
                        }
                    }
                },
                async: false,
            });
            getTaskInfo();
        });
        var initializationDataTable = function () {
            table = $('#datalist-table').dataTable({
                "autoWidth": true,
                "bLengthChange": false,
                "oLanguage": {
                    "sProcessing": "正在加载数据...",
                    "sZeroRecords": "没有您要搜索的内容",
                    "sInfo": "从_START_ 到 _END_ /共 _TOTAL_ 条",
                    "sInfoEmpty": "记录数为0",
                    "sInfoFiltered": "(全部记录数 _MAX_  条)",
                    "sInfoPostFix": "",
                    "sUrl": "",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "上一页",
                        "sNext": "下一页",
                        "sLast": "末页"
                    }
                },
                ordering: false,
                bProcessing: true,
                bStateSave: true,
                serverSide: true,
                searching: false,
                aLengthMenu: [25],
                "ajax": {
                    url: apiUrl,
                    "dataSrc": function (json) {
                        if (json.IsSccuess) {
                            var newjson = new Array();
                            //循环数据去掉不需要的数据
                            for (var i = 0; i < json.Data.Items.length; i++) {
                                var tempobj = new Object();
                                for (var k = 0; k < json.Data.Columns.length; k++) {
                                    tempobj[json.Data.Columns[k]] = json.Data.Items[i].Values[k];
                                }
                                newjson.push(tempobj);
                            }
                            //console.log(newjson);
                            return newjson;
                        } else {
                            if (IsLogined(json.ErrorCode)) {
                                alert("失败（" + "错误代码：" + json.ErrorCode + "，错误信息：" + json.Message + ")");
                            }
                        }
                        return [];
                    },
                    "data": function (d) {
                        draw = d.draw;
                        if (page == 1) {
                            page++;
                            return $.extend({}, { "sys:sno": "BATCH" }, { "sys:act": "GetDataList" }, { "BatchId": batchId }, { "Status": $("#Status").val() }, { "draw": d.draw }, { "length": d.length }, { "Page": parseInt(d.start / d.length) }, { "noAjaxForOne": true });
                        } else {
                            return $.extend({}, { "sys:sno": "BATCH" }, { "sys:act": "GetDataList" }, { "BatchId": batchId }, { "Status": $("#Status").val() }, { "draw": d.draw }, { "length": d.length }, { "Page": parseInt(d.start / d.length) });
                        }
                    }
                },
                //columns: cols
                columns: cols
            });
        }
        var getTaskInfo = function () {
            $.ajax({
                url: apiUrl,
                data: {
                    "sys:sno": "Task",
                    "sys:act": "Get",
                    "TaskId": taskId
                },
                dataType: "json",
                success: function (data) {
                    if (data.IsSccuess) {
                        $("#SourceName").val(data.Data.DtSourceText);//名称
                        $("#TableName").val(data.Data.DtTableText);
                        $("#TaskName").val(data.Data.Name);
                        $("#BatchId").val(batchId);
                        $("#CreatedTime").val(data.Data.LastExecutedTime);
                    } else {
                        if (IsLogined(data.ErrorCode)) {
                            alert(data.Message);
                        }
                    }
                },
                beforeSend: function () {
                    // $("btn_login").html("登录中...");
                }
            });
        }

    </script>
    <!--<div id="datalist-table_wrapper" class="dataTables_wrapper form-inline no-footer">
        <table  class="table table-bordered table-hover dataTable no-footer" >
            <thead>
            </thead>
            <tbody>
            </tbody>
        </table>
        <div class="dt-toolbar-footer">
            <div class="col-xs-12 col-sm-6">
                <div class="dataTables_info" id="datalist-table_info">从1 到 4 /共 4 条</div>
            </div>
            <div class="col-xs-12 col-sm-6">
                <div class="dataTables_paginate paging_simple_numbers" id="datalist-table_paginate">
                    <ul class="pagination pagination-sm">
                        <li class="paginate_button previous"  tabindex="0" ><a href="#">上一页</a></li>
                        <li class="paginate_button active"  tabindex="0"><a href="#">1</a></li>
                        <li class="paginate_button next"  tabindex="0"><a href="#">下一页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>-->
</body>
</html>
